package com.aaa.doctor.controller;

import com.aaa.doctor.feign.UserFeign;
import com.aaa.doctor.service.SchedulingService;
import com.aaa.doctor.vo.Scheduling2Vo;
import com.aaa.doctor.vo.SchedulingVo;
import com.aaa.doctor.vo.SchedulingVoo;
import com.aaa.entity.User;
import com.aaa.vo.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @version 1.8.0_181
 * @Author ZXJ
 * @Date 2023/3/29 8:53
 * @注释
 */
@RestController
@RequestMapping("/doctor/scheduling")
public class SchedulingController {
    @Resource
    private SchedulingService schedulingService;

    @Resource
    private UserFeign userFeign;

    @PostMapping("/queryScheduling")
    @ApiOperation(value = "医生排班")
    public Result queryScheduling(@RequestBody SchedulingVoo schedulingVoo){
        return schedulingService.queryScheduling(schedulingVoo);
    }



    @GetMapping("getUserList")
    public Result<List<User>> getUserList(){
        List<User> listAll = userFeign.getListAll();
        return new Result<>(200,"查询所有用户成功",listAll);
    }

    @PostMapping("/queryMyScheduling")
    @ApiOperation(value = "我的排班")
    public Result queryMyScheduling(@RequestBody SchedulingVoo schedulingVoo){
        return schedulingService.queryMyScheduling(schedulingVoo);
    }



    //查询所有的排班信息
    @ApiOperation(value = "门诊挂号查询所有医生排班信息")
    @PostMapping("/getDeptForScheduling")
    public Result getDeptForScheduling(@RequestBody SchedulingVo schedulingVo){
        return schedulingService.getDeptForScheduling(schedulingVo);
    }


    //修改排班信息
    @PostMapping("/editScheduling")
    public Result editScheduling(@RequestBody Scheduling2Vo scheduling2Vo){
        return schedulingService.editScheduling(scheduling2Vo);
    }
}
